<template>
	<view class="box-component">
		<view class="title-box" v-if="title">
			<view class="left">
				{{title}}
			</view>
			<view class="right" v-if="rightNav" @click="custom">
				<view class="size">
					{{rightNav}}
				</view>
				<image :src="$IMG_URL('/static/home/indicate.png')" mode="" class="icon"></image>
			</view>
		</view>
	    <!-- 插槽内容将在这里显示 -->
	    <slot></slot>
	  </view>
</template>

<script>
	export default{
		props: {
			title: {
				type: String,
				default: '',
				required: true
			},
			rightNav: {
				type: String,
				default: '',
				required: true
			}
		},
		data(){
			return{
				
			}
		},
		methods:{
			custom(){
				this.$emit('custom')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box-component{
		width: 702rpx;
		background: #ffffff;
		border-radius: 16rpx;
		padding: 20rpx 24rpx;
		display: flex;
		flex-direction: column;
		margin-bottom:24rpx;
		.title-box{
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-bottom: 20rpx;
			.left{
				flex: 1;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC-Heavy;
				font-weight: 800;
				text-align: left;
				color: #333333;
				
			}
			.right{
				display: flex;
				flex-direction: row;
				align-items: center;
				.size{
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					color: #999999;
				}
				.icon{
					width: 10rpx;
					height: 16rpx;
					margin-left: 7rpx;
				}
			}
		}
	}
</style>